package org.pb;

import java.util.ArrayList;
import java.util.List;


import com.google.android.maps.GeoPoint;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.OverlayItem;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.View.OnClickListener;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class ShowArchivalOrder extends Activity implements OnClickListener{
	private TextView regTimestamp;
	private TextView status;
	private TextView comment;
	private TextView executionTimestamp;
	private TextView finishTimestamp;
	private String startLatitude;
	private String startLongitude;
	private String stopLatitude;
	private String stopLongitude;
	private MapView mapView;
	private View button;
	private GeoPoint pinPoint;



	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.showarchivalorder);

			
		regTimestamp = (TextView) findViewById(R.id.TextView01);
		status = (TextView) findViewById(R.id.TextView06);
		comment = (TextView) findViewById(R.id.TextView08);
		executionTimestamp = (TextView) findViewById(R.id.TextView04);
		finishTimestamp = (TextView) findViewById(R.id.TextView10);
button= (View) findViewById(R.id.button1);
button.setOnClickListener(this);
	
		Bundle extras = getIntent().getExtras();
		if(extras !=null) {
		regTimestamp.setText(extras.getString("regTimestamp"));
		status.setText(extras.getString("orderStatus"));
		comment.setText(extras.getString("comment"));
		executionTimestamp.setText(extras.getString("executionTimestamp"));
		startLatitude=extras.getString("startLatitude");
		startLongitude=extras.getString("startLongitude");
		stopLatitude=extras.getString("stopLatitude");
		stopLongitude=extras.getString("stopLongitude");
		
	//	Location startLocation = new Location("startLocation");
	//	Location stopLocation = new Location("stopLocation");
	 //    GeoPoint startPoint = new GeoPoint((int)(new Double(startLatitude)*1000000), (int) (new Double(startLongitude)*1000000));
	  //   GeoPoint stopPoint = new GeoPoint((int)(new Double(stopLatitude)*1000000), (int) (new Double(stopLongitude)*1000000));
//startLocation.setLatitude(startPoint.getLatitudeE6());
//startLocation.setLongitude(startPoint.getLongitudeE6());
//stopLocation.setLatitude(stopPoint.getLatitudeE6());
//stopLocation.setLongitude(stopPoint.getLongitudeE6());
finishTimestamp.setText(extras.getString("finishTimestamp"));

		
		
		

		 
		
		
		
		
		
		}

	}



	public void onClick(View arg0) {
		
		Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
				Uri.parse("http://maps.google.com/maps?saddr="+startLatitude+","+startLongitude+"&daddr="+stopLatitude+","+stopLongitude));
				startActivity(intent);
	}






}
